load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "democluster",
    srcs = [
        "api.go",
        "context.go",
        "demo_cluster.go",
        "demo_locality_list.go",
        "doc.go",
        "session_persistence.go",
        "socket_unix.go",
        "socket_windows.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/cli/democluster",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/cli/clicfg",
        "//pkg/cli/clierror",
        "//pkg/cli/cliflags",
        "//pkg/cli/democluster/api",
        "//pkg/jobs",
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/multitenant",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/security",
        "//pkg/security/certnames",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/server/authserver",
        "//pkg/server/pgurl",
        "//pkg/server/serverpb",
        "//pkg/server/status",
        "//pkg/sql",
        "//pkg/sql/catalog/catalogkeys",
        "//pkg/sql/isql",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sqlclustersettings",
        "//pkg/storage/fs",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/serverutils/regionlatency",
        "//pkg/util/envutil",
        "//pkg/util/humanizeutil",
        "//pkg/util/log",
        "//pkg/util/log/logcrash",
        "//pkg/util/log/logpb",
        "//pkg/util/log/severity",
        "//pkg/util/netutil/addr",
        "//pkg/util/retry",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "//pkg/workload",
        "//pkg/workload/histogram",
        "//pkg/workload/workloadsql",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//oserror",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_nightlyone_lockfile//:lockfile",
        "@org_golang_x_time//rate",
    ],
)

go_test(
    name = "democluster_test",
    srcs = ["demo_cluster_test.go"],
    embed = [":democluster"],
    shard_count = 16,
    deps = [
        "//pkg/base",
        "//pkg/ccl/kvccl/kvtenantccl",
        "//pkg/cli/clisqlclient",
        "//pkg/cli/clisqlexec",
        "//pkg/multitenant/tenantcapabilities",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/sql/sqlclustersettings",
        "//pkg/storage/fs",
        "//pkg/testutils",
        "//pkg/testutils/serverutils/regionlatency",
        "//pkg/testutils/skip",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
    ],
)
